package com.topisv.tms.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.StoragePartition;

public interface StoragePartitionDao extends PagingAndSortingRepository<StoragePartition, Long>, JpaSpecificationExecutor<StoragePartition>{
	/*@Modifying
	@Query("select st from Storage st where st.areaGroup.id = ?1")
	List<Storage> getByAreaGroupId(Long id);
	
	@Query("select st from Storage st where st.areaGroup.id = ?1 and st.type=?2")
	List<Storage> findByAreaGroup(Long areaGroupId,String type);*/
	
	@Query("select st from StoragePartition st where st.partition_code = ?1")
	StoragePartition findByCode(String partition_code);
	
	@Query("select st from StoragePartition st where st.storage_code = ?1")
	List<StoragePartition> findBySPCode(String partition_code);
}
